package com.gitee.wsl.mathematics.matrix

import com.gitee.wsl.mathematics.matrix.mat2.Mat2
import com.gitee.wsl.mathematics.matrix.mat3.Mat3
import com.gitee.wsl.mathematics.matrix.mat4.Mat4
import kotlin.test.Test
import kotlin.test.assertEquals

class DetTest {
    @Test
    fun mat2_det() =
        assertEquals(-2.0, Mat2(1.0, 2.0, 3.0, 4.0).det)

    @Test
    fun mat3_det() =
        assertEquals(
            0.0,
            Mat3(
                1.0, 2.0, 3.0,
                4.0, 5.0, 6.0,
                7.0, 8.0, 9.0
            ).det
        )

    @Test
    fun mat4_det() =
        assertEquals(
            -376.0,
            Mat4(
                1.0, 3.0, 5.0, 9.0,
                1.0, 3.0, 1.0, 7.0,
                4.0, 3.0, 9.0, 7.0,
                5.0, 2.0, 0.0, 9.0
            ).det
        )
}

val tempMat4 = Mat4(
    1.0, 3.0, 5.0, 9.0,
    1.0, 3.0, 1.0, 7.0,
    4.0, 3.0, 9.0, 7.0,
    5.0, 2.0, 0.0, 9.0
)